<template>
    <div class="menu_outer">
        <div class="menu">
            <div style="">

                <div class="list">
                    <div class="line1" v-for="item in list2" :key="item.id" @click="gourl(item.url)">{{ item.title }}
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
export default {
    name: "leftMenu",
    data() {
        return {
            list2: []
        };
    },

    computed: {
        path() {
            return this.$route.path
        }

    },
    mounted() {
        this.getLeft()
    },
    methods: {
        // 点击跳转外部链接
        gourl(url) {
            if (url) {
                window.open(url, '_blank', 'noopener,noreferrer');
            }
        },
        getLeft() {
            this.$api.getLibLeft().then(res => {
                console.log(res)
                if (res.data.code == 1) {
                    this.list2 = res.data.data

                }
            })
        },

        goPage(url) {
            console.log(this.path, url);

            if (this.path != url) {
                this.$router.push(url)
            }
        },
    },
}
</script>
<style lang="scss" scoped>
.menu_outer {
    width: 300px;
    height: 100%;
}

.menu {
    width: 300px;
    height: 100%;
    background: #E7F1FE;
    padding: 30px 1.15rem;
    position: -webkit-sticky;
    left: 8.33rem;
    position: sticky;
    top: 128px;
>div{
    position: sticky;top: 128px;
}
    .fix_m {

        >div {
            cursor: pointer;
            margin-bottom: 1.25rem;
            font-weight: 400;
            font-size: 1.25rem;
            color: #333333;

            &:hover {
                color: #1068E7;
            }
        }
    }

    .list {
        // border-top: 0.01rem solid #CCCCCC;
        // padding-top: 1.51rem;

        >div {

            cursor: pointer;
            margin-bottom: 1.25rem;
            font-weight: 400;
            font-size: 1.25rem;
            color: #333333;

            &:hover {
                color: #1068E7;
            }
        }
    }
}
</style>